cmake_minimum_required(VERSION 2.12)
project(p2p_planner)

#设置库文件可执行程序路径
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)

find_package(Eigen3 REQUIRED)
find_package(OpenCV REQUIRED)


INCLUDE_DIRECTORIES(include ${EIGEN3_INCLUDE_DIRS})
add_library(${PROJECT_NAME} SHARED
        src/distance_map_planner/distance_map_planner.cpp
        src/distance_map_planner/dmp_graph_search.cpp
        src/jps_planner/jps.cpp
        src/jps_planner/jps_graph_search.cpp
        src/planner.cpp
        )
target_link_libraries(${PROJECT_NAME}
        PUBLIC navi_common
        )
target_include_directories(${PROJECT_NAME}
        PUBLIC include
        PUBLIC ${EIGEN3_INCLUDE_DIRS})

add_executable(${PROJECT_NAME}_demo example/test_distance_map_planner_2d.cpp)

target_link_libraries(${PROJECT_NAME}_demo
        PUBLIC ${PROJECT_NAME}
        )
install(TARGETS ${PROJECT_NAME}
        RUNTIME DESTINATION bin
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib
        )


install(DIRECTORY
        include/p2p_util
        include/planner
        include/jps_collision
        DESTINATION include)